package com.twu.biblioteca.ui;

import com.twu.biblioteca.data.BookDAO;
import com.twu.biblioteca.data.MovieDAO;
import com.twu.biblioteca.data.User;

/**
 * Created by florian on 6/01/14.
 */
public class MainScreenControllerLoggedIn extends MainScreenController {


    private User user;

    public MainScreenControllerLoggedIn(ScreenControllerFactory screenControllerFactory, BibliotecaUI ui, BookDAO bookDAO, MovieDAO movieDAO,User user) {
        super(screenControllerFactory, ui, bookDAO, movieDAO);
        this.user = user;
    }

    @Override
    protected void showMenu() {
        ui.showLoggedInMainMenu();
    }

    @Override
    public ScreenController processCommand(String line) {
        if (line.equals("10")) {
            return invalidOption();
        }else if (line.equals("2")) {
            return screenControllerFactory.createBookCheckoutScreenController();
        }else if (line.equals("3")){
            return screenControllerFactory.createReturnBooksController();
        }else if (line.equals("5")) {
            return screenControllerFactory.createMovieCheckoutScreenController();
        }else if (line.equals("6")) {
            ui.showUserInfo(user);
            return this;
        }else {
            return super.processCommand(line);
        }
    }
}
